University of Amsterdam
6 November 2026
In this lecture we aim to:
Reading: Chapter 10 (ยง10.1โ10.3)
In statistics and regression analysis, moderation occurs when the relationship between two variables depends on a third variable. The third variable is referred to as the moderator variable or simply the moderator. The effect of a moderating variable is characterized statistically as an interaction.
Source WIKIPEDIA
\(\definecolor{red}{RGB}{255,0,0} \definecolor{black}{RGB}{0,0,0} \color{black}Out_i = b_0 + b_1 Pred_i + b_2 Mod_i + \color{red}b_3 Pred_i \times Mod_i \color{black}+ \epsilon_i\)
A selection from Field (8.3 Bias in linear models):
For simple regression
Additionally, for multiple regression
\[\definecolor{red}{RGB}{255,0,0} \definecolor{black}{RGB}{0,0,0} \begin{aligned} \color{black}\text{wakefulness}_i = {} & b_0 + b_1\,\text{hours.awake}_i + b_2\,\text{ml.coffee}_i \\ & + \color{red}b_3\,\text{hours.awake}_i \times \text{ml.coffee}_i \color{black}+ \epsilon_i \end{aligned}\]
Take it for a spin
Estimate Std. Error t value Pr(>|t|)
(Intercept) 61.6830508 12.103218305 5.096417 1.732742e-06
hours.awake -3.6115498 1.123005892 -3.215967 1.772112e-03
ml.coffee 0.2656631 0.042872680 6.196560 1.437213e-08
hours.awake:ml.coffee 0.1024289 0.004037037 25.372290 2.355332e-44
\(\definecolor{red}{RGB}{255,0,0} \definecolor{black}{RGB}{0,0,0} \color{black}\widehat{Out_i} = b_0 + b_1 Pred_i + b_2 Mod_i + \color{red}b_3 Pred_i \times Mod_i \color{black}\)
\(\definecolor{red}{RGB}{255,0,0} \definecolor{black}{RGB}{0,0,0} \color{black}\widehat{Out_i} = 61.68 + -3.61 \times Pred_i + 0.27 \times Mod_i + \color{red} 0.1 \times Pred_i \times Mod_i \color{black}\)
\(\definecolor{red}{RGB}{255,0,0} \definecolor{black}{RGB}{0,0,0} \color{black}\widehat{Out_i} = 61.68 + -3.61 \times 15 + 0.27 \times 213 + \color{red} 0.1 \times 15 \times 213 \color{black} \approx 391.36\)
\(r^2\) is the proportion of blue to orange, while \(1 - r^2\) is the proportion of red to orange
| Model | R2 | Adjusted R2 | R2 change | F change | df1 | df2 | p |
|---|---|---|---|---|---|---|---|
| M0 | 0.000 | 0.000 | 0.000 | 0 | 99 | ||
| M1 | 0.912 | 0.910 | 0.912 | 504.412 | 2 | 97 | < .001 |
| M2 | 0.989 | 0.988 | 0.076 | 643.753 | 1 | 96 | < .001 |
Note. M1 includes hours.awake, ml.coffee
Note. M2 includes hours.awake, ml.coffee, hours.awake:ml.coffee
| Not centered | Centered | |
|---|---|---|
| \(b_1\) (hours.awake) | -3.612, at 0 ml coffee | 23.013, at the mean (260 ml) |
| \(b_2\) (ml.coffee) | 0.266, at 0 hours awake | 1.269, at the mean (9.8 hours) |
| \(b_3\) (interaction) | 0.102 | 0.102 |
| Linear regression | Process module | |
|---|---|---|
| \(b_3\) (interaction) | 0.102 | 0.102 |
| \(b_1\), \(b_2\) | -3.612, 0.266 (not centered) | 23.013, 1.269 (centered by default) |
| Test | \(t\) | \(z\), SEs slightly smaller (\(\times\) 0.98 here) |
| Also gives | \(R^2\) change, assumption checks | Simple slopes |

Scientific & Statistical Reasoning